Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

Previous Next

Suggestions

Ann,

If your end users are running a Notes client and you want to call your Java code to modify field data, try putting your code in a Notes agent, and calling it from the PostSave form event:

@Command([RunAgent]; "JavaAgent")

Do you have to use Java for the UI? If not:

1) Get rid of the Swing code and the "implements PropertyChangeListener".
2) Drop the propertyChange method.
3) Drop the Thread.sleep loop (this may be causing your memory problem).

Also, don't attempt to access an object you've already recycled (you're recycling 'doc' at the top of the agent and then accessing it later).

Your agent should look similar to this:

import lotus.domino.*;

public class JavaAgent extends AgentBase {

public void NotesMain() {

try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
Document doc = agentContext.getDocumentContext();

RichTextItem rtItem = (RichTextItem) doc.getFirstItem("Body");
String text = rtItem.getUnformattedText();
rtItem.remove();
doc.save(true);

String encodedText = encode(text);

RichTextItem newRtItem = doc.createRichTextItem("Body");
newRtItem.appendText("My encoded text: " + encodedText);
doc.save(true);

} catch (Exception e) {
e.printStackTrace();
}
}
}


Feedback response number RPAI88TSBK created by ~Tip Umfooburynds on 08/30/2010

anyone gotten a large Java agent to... (~Denise Elhipil... 19.Aug.10)
. . Make sure the Java code is cleaning... (~Ethan Dwotoobe... 19.Aug.10)
. . . . meaning? (~Denise Elhipil... 20.Aug.10)
. . Try changing JavaMaxHeapSize in not... (~Wendy Bubluski... 23.Aug.10)
. . . . tried that, too (~Denise Elhipil... 23.Aug.10)
. . . . . . Yes, posting the code would likely ... (~Wendy Bubluski... 23.Aug.10)
. . . . . . . . answers (~Denise Elhipil... 30.Aug.10)
. . . . . . . . . . Suggestions (~Wendy Bubluski... 30.Aug.10)
. . . . . . . . . . . . more answers (~Denise Elhipil... 31.Aug.10)
. . Have you recycle? (~Vijay Xantooma... 19.Aug.10)
. . . . yes (~Denise Elhipil... 20.Aug.10)




Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS